#include "MagnetProcessor.h"
#include "MagnetBuff.h"
#include "MainLayer.h"
#include "InputLayer.h"

MagnetProcessor::MagnetProcessor(void)
{
	_time = 0;
}


MagnetProcessor::~MagnetProcessor(void)
{
}

void MagnetProcessor::process( PlayerPlane* plane, MainLayer* mainLayer )
{
	MagnetBuff* buff = MagnetBuff::create();
	buff->setTimeMax(_time);
	buff->setPlane(plane);
	buff->setId(getId());

	mainLayer->getInputLayer()->getStateBar()->addBuff(buff);
}

void MagnetProcessor::parseXml( xml_node node )
{
	float time = node.child("Time").text().as_float();
	_time = time;
}
